package com.mcms.web.vo;

public class PagePara {

	private int pageIndex;// 当前页码
	private int pageSize;// 
	private int recordStart;
	private int total;// 总记录数

	public int getPageIndex() {
		return pageIndex < 1 ? 1 : pageIndex;
	}

	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
		setRecordStart(getPageSize() * (getPageIndex() - 1));
	}

	public int getPageSize() {
		return pageSize <= 0 ? 10 : pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
		setRecordStart(getPageSize() * (getPageIndex() - 1));
	}

	public int getRecordStart() {
		return recordStart < 0 ? 0 : recordStart;
	}

	public void setRecordStart(int recordStart) {
		this.recordStart = recordStart;
	}

	public int getRecordEnd() {
		return getRecordStart() + getPageSize();
	}

	public int getTotal() {
		return total < 0 ? 0 : total;
	}

	public void setTotal(int total) {
		this.total = total;
	}
}
